//
//  LeftViewController.m
//  CarHome
//
//  Created by dlios on 15-3-23.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "LeftViewController.h"
#import "LeftTableViewCell.h"
#import "MMDrawerBarButtonItem.h"
#import "MMDrawerVisualState.h"
#import "UIViewController+MMDrawerController.h"
#import "AllViewController.h"
#import "WifeViewController.h"
#import "BeautyViewController.h"
#import "FanousViewController.h"

@interface LeftViewController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) NSMutableArray *arr;




@end

@implementation LeftViewController

- (void)dealloc
{
    [_tableView release];
    [_arr release];
    [super dealloc];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.arr = [NSMutableArray arrayWithObjects:@"媳妇当车模", @"全部", @"美人计", @"论坛名人堂", nil];

    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatMenu];
    
    
}

#pragma mark - 侧边栏

- (void)creatMenu
{
    UITableView *tab = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, self.view.frame.size.height - 64) style:UITableViewStylePlain];
    tab.delegate = self;
    tab.dataSource = self;
    [tab registerClass:[LeftTableViewCell class] forCellReuseIdentifier:@"cell"];
    [self.view addSubview:tab];
    [tab release];
}

#pragma mark - tableview协议

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.arr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LeftTableViewCell *cell = [[LeftTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
    cell.textLabel.text = [self.arr objectAtIndex:indexPath.row];
    return cell;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
